package cn.xiaolang.thread.supplier2consume;

import lombok.AllArgsConstructor;
import lombok.Data;

public class ApplyDemo {


    public static void main(String[] args) throws InterruptedException {
        ConsumerLambda<Object> supplierConsumer = new ConsumerLambda<>();
        supplierConsumer.start();
        for (int i = 0; i < 10000; i++) {
            supplierConsumer.addToQueue(new User(i, "user" + 1));
        }

    }

    @Data
    @AllArgsConstructor
    static class User {
        private int id;

        private String name;

        @Override
        public String toString() {
            return "User{" +
                    "id=" + id +
                    ", name='" + name + '\'' +
                    '}';
        }
    }
}
